#include <stdio.h>
void copy_arr(double ar[], const double source[], int num);
void copy_ptr(double* ar, const double* sr, int num);
void copy_ptrs(double* ar, double* start, double* end);
int main(void)
{
	double source[5]= {1.1, 2.2, 3.3, 4.4, 5.5};
	double target1[5];
	double target2[5];
	double target3[5];
	
	copy_arr(target1, source, 5);
	copy_ptr(target2, source, 5);
	copy_ptrs(target3,source,source+5);	
	
	return 0;
}

void copy_arr(double ar[], const double source[], int num)
{
	int i;
	for(i=0;i<num;i++){
		ar[i]=source[i];		
		printf("%f\n",ar[i]);
	}

	return;
}

void copy_ptr(double* ar, const double* sr, int num)
{
	int i;
	for(i=0;i<num;i++,sr++){
		*ar=*sr;
		printf("%f\n",*ar);
		ar++;
	}
		
	return;
}
void copy_ptrs(double* ar, double* start, double* end)
{
	for(;start<end;start++){
		*ar=*start;
		printf("%f\n",*ar);
	}
			
	return;
}
